home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / bit / src / paint.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  8KB  |  202 lines

  1. /*
  2.  * $Id: paint.h,v 0.91 1994/02/20 00:53:42 zhao Pre-Release $
  3.  *
  4.  *. This file is part of BIT shareware package. After the two weeks of
  5.  *  free evaluation period, you are encouraged (required) to register
  6.  *  your copy for a small registration fee, which is $35 for personal use
  7.  *  and $50 for commercial, government and institutional use.
  8.  *
  9.  *  Copyright(c) 1993, 1994 by T.C. Zhao.
  10.  *  All rights reserved.
  11.  *
  12.  *  Permission to use, copy, and distribute this software in its entirety
  13.  *  for non-commercial purposes is hereby granted, provided that the
  14.  *  above shareware and copyright notices and this permission notice
  15.  *  appear in all copies and their documentation.
  16.  *
  17.  *  This software may be modified for your own use, but modified versions
  18.  *  may not be distributed without prior consent of the author.
  19.  *
  20.  *  This software is provided "as is" without expressed or implied
  21.  *  warranty of any kind.
  22.  *
  23.  *.
  24.  *
  25.  */
  26. #ifndef PAINT_H_
  27. #define PAINT_H_
  28.  
  29. #ifdef PAINT_DRIVER
  30.  
  31. #define BITMAP_W 30
  32. #define BITMAP_H 30
  33.  
  34. #if 0
  35. static char curve_bits[] =
  36. {
  37.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  38.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  39.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  40.     0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x08, 0xc0, 0x1f, 0x00, 0x1c,
  41.     0x60, 0x38, 0x00, 0x0e, 0x70, 0x70, 0x00, 0x07, 0x30, 0x60, 0x80, 0x03,
  42.     0x18, 0xc0, 0xc0, 0x01, 0x18, 0xc0, 0xe0, 0x00, 0x0c, 0xc0, 0x70, 0x00,
  43.     0x0c, 0xc0, 0x30, 0x00, 0x0c, 0x80, 0x19, 0x00, 0x0c, 0x80, 0x1f, 0x00,
  44.     0x0c, 0x00, 0x0f, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  45.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  46.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  47. };
  48. #endif
  49.  
  50. static char arc_bits[] =
  51. {
  52.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  53.     0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xff, 0x7f, 0x00,
  54.     0xc0, 0x07, 0xf0, 0x01, 0xe0, 0x00, 0x80, 0x03, 0x38, 0x00, 0x00, 0x0e,
  55.     0x1c, 0x00, 0x00, 0x1c, 0x18, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x06,
  56.     0x60, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x80, 0x01, 0x80, 0x01, 0xc0, 0x00,
  57.     0x00, 0x03, 0x60, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0c, 0x18, 0x00,
  58.     0x00, 0x18, 0x0c, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00, 0x60, 0x03, 0x00,
  59.     0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  60.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  61.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  62. };
  63.  
  64.  
  65. static char ray_bits[] =
  66. {
  67.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  68.     0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x03, 0x60, 0xc0, 0x80, 0x03,
  69.     0xe0, 0xc0, 0xc0, 0x01, 0xc0, 0xc1, 0xe0, 0x00, 0x80, 0xc3, 0x70, 0x00,
  70.     0x00, 0xc7, 0x38, 0x00, 0x00, 0xce, 0x1c, 0x00, 0x00, 0xdc, 0x0e, 0x00,
  71.     0x00, 0xf8, 0x07, 0x00, 0x00, 0xf0, 0x03, 0x00, 0xf8, 0xff, 0xff, 0x0f,
  72.     0xf8, 0xff, 0xff, 0x0f, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf8, 0x07, 0x00,
  73.     0x00, 0xdc, 0x0e, 0x00, 0x00, 0xce, 0x1c, 0x00, 0x00, 0xc7, 0x38, 0x00,
  74.     0x80, 0xc3, 0x70, 0x00, 0xc0, 0xc1, 0xe0, 0x00, 0xe0, 0xc0, 0xc0, 0x01,
  75.     0x70, 0xc0, 0x80, 0x03, 0x20, 0xc0, 0x00, 0x01, 0x00, 0xc0, 0x00, 0x00,
  76.     0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  77. };
  78.  
  79.  
  80. static char line_bits[] =
  81. {
  82.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
  83.     0x1c, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
  84.     0xe0, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
  85.     0x00, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
  86.     0x00, 0x38, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00,
  87.     0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00,
  88.     0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x38, 0x00,
  89.     0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xc0, 0x01,
  90.     0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0e,
  91.     0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  92. };
  93.  
  94.  
  95. static char fpoly_bits[] =
  96. {
  97.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  98.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  99.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x3c, 0x00, 0x3e, 0x00,
  100.     0x7c, 0x00, 0x67, 0x00, 0xcc, 0x81, 0xc3, 0x00, 0x8c, 0xc7, 0x81, 0x01,
  101.     0x0c, 0xfe, 0x00, 0x03, 0x0c, 0x38, 0x00, 0x07, 0x0c, 0x00, 0x00, 0x06,
  102.     0x0c, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x06,
  103.     0x0c, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x06,
  104.     0x0c, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x06,
  105.     0x0c, 0x00, 0x00, 0x06, 0xfc, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0x07,
  106.     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  107. };
  108.  
  109.  
  110. static char circ_bits[] =
  111. {
  112.     0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xfe, 0x3f, 0x00,
  113.     0x00, 0x0d, 0x58, 0x00, 0xc0, 0x03, 0xe0, 0x01, 0xa0, 0x00, 0x80, 0x02,
  114.     0x60, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x06, 0x28, 0x00, 0x00, 0x0a,
  115.     0x18, 0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x18,
  116.     0x0c, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x18, 0x0c, 0x80, 0x00, 0x18,
  117.     0x0c, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x18,
  118.     0x18, 0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x0c, 0x28, 0x00, 0x00, 0x0a,
  119.     0x30, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x03, 0xa0, 0x00, 0x80, 0x02,
  120.     0xc0, 0x03, 0xe0, 0x01, 0x00, 0x0d, 0x58, 0x00, 0x00, 0xfe, 0x3f, 0x00,
  121.     0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  122. };
  123.  
  124. static char rec_bits[] =
  125. {
  126.     0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x1f,
  127.     0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
  128.     0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
  129.     0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
  130.     0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
  131.     0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
  132.     0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
  133.     0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
  134.     0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
  135.     0xfe, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00
  136. };
  137.  
  138. /**** All patterns ********/
  139. #include "bitmaps/pat_solid.xbm"
  140. #include "bitmaps/pat_hollow.xbm"
  141.  
  142. #include "bitmaps/pat_chess.xbm"
  143. #include "bitmaps/pat_ichess.xbm"
  144. #include "bitmaps/pat_checker4.xbm"
  145.  
  146. #include "bitmaps/pat_icirc2.xbm"
  147. #include "bitmaps/pat_circ2.xbm"
  148. #include "bitmaps/pat_rcirc.xbm"
  149.  
  150. #include "bitmaps/pat_grid32.xbm"
  151. #include "bitmaps/pat_grid32x.xbm"
  152. #include "bitmaps/pat_grid16.xbm"
  153.  
  154. #include "bitmaps/pat_dots.xbm"
  155. #include "bitmaps/pat_rdots.xbm"
  156. #include "bitmaps/pat_griddots.xbm"
  157.  
  158. #include "bitmaps/pat_rhash.xbm"
  159. #include "bitmaps/pat_lhash.xbm"
  160. #include "bitmaps/pat_vhash.xbm"
  161. #include "bitmaps/pat_hhash.xbm"
  162. #include "bitmaps/pat_hvhash.xbm"
  163.  
  164. #include "bitmaps/pat_fcc.xbm"
  165. #include "bitmaps/pat_sqctr.xbm"
  166. #include "bitmaps/pat_heart.xbm"
  167.  
  168. #include "bitmaps/pat_lbrick.xbm"
  169. #include "bitmaps/pat_lfbrick.xbm"
  170.  
  171. #include "bitmaps/pat_dn.xbm"
  172. #include "bitmaps/pat_rough.xbm"
  173.  
  174. #endif /* PAINT_DRIVER */
  175.  
  176. /**  constant and structs *****/
  177.  
  178. enum
  179.   {
  180.       PAT_SOLID, PAT_HOLLOW,
  181.       PAT_RHASH, PAT_LHASH, PAT_VHASH, PAT_HHASH, PAT_HVHASH,
  182.       PAT_CHESS, PAT_ICHESS, PAT_CHECKER4,
  183.       PAT_GRID32, PAT_GRID32X, PAT_GRID16,
  184.       PAT_CIRC, PAT_ICIRC, PAT_RAN_CIRC,
  185.       PAT_DOTS, PAT_RAN_DOTS, PAT_GRID_DOTS,
  186.       PAT_HEARTS, PAT_FCC, PAT_SQCTR,
  187.       PAT_LBRICK, PAT_LFBRICK,
  188.       PAT_DN, PAT_ROUGH,
  189.       /* must leave free as the last two */
  190.       PAT_FREE1, PAT_FREE2
  191.   };
  192.  
  193. typedef struct
  194.   {
  195.       int name;
  196.       int size;
  197.       char *mask;
  198.   }
  199. Pattern_t;
  200.  
  201. #endif
  202.